﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

#if UNITY_EDITOR
    [ExecuteInEditMode]
#endif
public class GizmosRoot : MonoBehaviour
{
    public delegate void ActDraw();
    public static ActDraw _actDraw1;
    public static ActDraw _actDraw;
    public bool bHave;
    public void SetDrawFunc(ActDraw actDraw)
    {
        _actDraw = actDraw;
        bHave = _actDraw != null;
    }
    public void SetDrawFunc1(ActDraw actDraw)
    {
        _actDraw1 = actDraw;
        bHave = _actDraw1 != null;
    }
    void OnDrawGizmos()
    {
        if (_actDraw != null)
        {
            _actDraw();
        }

        if (_actDraw1 != null)
        {
            _actDraw1();
        }

        bHave = _actDraw != null || _actDraw1 != null;
    }
}
